﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration.Provider;
using NLBS.Data;
using System.Collections.Specialized;
using System.Globalization;
using NLBS.Framework;
using NLBS.Provider;

namespace NLBS.Web
{
    public abstract class UrlFormatsProvider : ProviderBase
	{
        private static UrlFormatsProvider provider;
        private static GenericProviderCollection<UrlFormatsProvider> providers = ProviderConfigurationHelper.LoadProviderCollection<UrlFormatsProvider>("UrlFormats", out provider);

        /// <summary>
        /// Returns the currently configured DbProvider.
        /// </summary>
        /// <returns></returns>
        public static UrlFormatsProvider Instance()
        {
            return provider;
        }

        /// <summary>
        /// Returns a fully qualified Url using the specified format string.
        /// </summary>
        /// <param name="formatString">The pattern.</param>
        /// <param name="items">The items.</param>
        /// <returns></returns>
        protected string GetUrl(string formatString, params object[] items)
        {
            return BlogInfo.Instance().BaseUrl + string.Format(CultureInfo.InvariantCulture, formatString, items);
        }

        protected string GetUrl(string url)
        {
            return GetUrl(url, null);
        }

        public override void Initialize(string name, NameValueCollection configValue)
        {
            base.Initialize(name, configValue);
        }

        public abstract string Index();

        public abstract string RssUrl();

        public abstract string ArticleCategoryRssUrl(int catID);

        public abstract string CommentRssUrl();

        public abstract string ArticleCategoryUrl(int catID);

        public abstract string ArticleSelectedUrl();

        public abstract string ArticleModeUrl(string mode);

        public abstract string ArticleDateUrl(string date);

        public abstract string ArticleConent(int articleID);

        public abstract string Comment();

        public abstract string CommentEditUrl(int commentID,int logID);

        public abstract string CommentDeleteUrl(int commentID, int logID);

        public abstract string TrackBack();

        public abstract string ArticleTrackBack(int logID);

        public abstract string TrackBackDeleteUrl(int tbID);

        public abstract string GuestBook();

        public abstract string GuestBookEditUrl(int gbookID);

        public abstract string GuestBookDeleteUrl(int gbookID);

        public abstract string Login();

        public abstract string ArticleAction(string act, int articleID);

        public abstract string UserList();

        public abstract string UserDetail(int id);

        public abstract string UserDelete(int id);

        public abstract string Visitors();

        public abstract string SelectedArticle();

        public abstract string UserArticle(int id);

        public abstract string UserComment(int id);

        public abstract string[] ArticleComment(int id);

        public abstract string[] SingleComment(int id,int commentID);

        public abstract string CatComment(int id);
	}
}
